package com.erp;

import java.util.List;
import java.util.Vector;

public class VectorTest2 {

    public static void main(String[] args) throws InterruptedException {
        List<String> list = new Vector<>();
        Thread t1 = new Thread(() -> {
            for(int i = 0; i < 1000; i++) {
                list.add(String.valueOf(i));
            }
        });
        t1.start();

        Thread t2 = new Thread(() -> {
            for(int i = 1000; i < 2000; i++) {
                list.add(String.valueOf(i));
            }
        });
        t2.start();

        t1.join();
        t2.join();
        System.out.println(list.size());
    }
}
